<%# locals: question_version %>
<div class="question-version">

<%= div_tag 'div_qvsh_', question_version %>
<table>

  <%# show origin question type when an editing was cancelled %>
  <%
    if question_version.question_type_id_changed? && ! question_version.question_type_id_was.nil?
      question_type = QuestionType.find(question_version.question_type_id_was)
    else
      question_type = question_version.question_type
    end
  %>
  <%
    if question_version.data_changed? && ! question_version.data_was.nil?
      data = question_version.data_was
    else
      data = question_version.data
    end
  %>
  <% question_type.question_fields.input.each do |i| %>
    <tr>
      <td><%= i.name %></td>
      <td><%= data[i.position] %></td>
    </tr>
  <% end %>
</table>
</div>
</div>